import React, { Component } from 'react'
import Context from '../../utils/context'
export default class Alert2 extends Component {
    state = { typeIndex: 0 }
    static contextType=Context;
    render() {
        let {con: { type1, type2 }}=this.context.context;
        let { setN, bottomani,closeAlert1 } = this.context
        return (
            // <div className={`${bottomani}`}>
            //     <h2 onClick={closeAlert1}>关闭</h2>
            //     <div>
            //         <span className='active'>{type1.con.name}</span>
            //         {type2.con.map((item, index) => { return <span className={this.state.typeIndex === index ? 'active' : null} key={index} onClick={() => { this.setState({ typeIndex: index }) }}>{item.name}</span> })}
            //         <p>
            //             <button onClick={()=>{setN();closeAlert1()}}>加入购物车</button> &nbsp;
            //             <button onClick={closeAlert1}>取消</button>
            //         </p>
            //     </div>
            // </div>
            <div>
            <h1 onClick={closeAlert}>关闭</h1>
            <Banner list={list} />
            <h2>{name}</h2>
            <div><button onClick={this.addCar}>加入购物车</button>:{this.state.n}</div>
            {isShow1 ? <Context.Provider value={{...this}}><Alert1/></Context.Provider> : null}
        </div>
        )
       
    }
    
}
